﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NewStart
{
    public static class BootStrapHelper
    {
        public static bool BootStrap()
        {
            try
            {
                if (Program.programVersion != ShortcutsHelper.ReadOnlineVersion() && !System.IO.File.Exists("DEBUG_NOVERSIONCHECK"))
                {
                    System.Windows.Forms.MessageBox.Show("New Version available: " + ShortcutsHelper.ReadOnlineVersion());
                    System.Diagnostics.Process.Start("http://newstart.codeplex.com/");
                }

                if (!System.IO.File.Exists("MouseKeyboardActivityMonitor.dll"))
                    System.IO.File.WriteAllBytes("MouseKeyboardActivityMonitor.dll", Properties.Resources.MouseKeyboardActivityMonitor);

                if (!System.IO.File.Exists("SerialKILLER.dll"))
                    System.IO.File.WriteAllBytes("SerialKILLER.dll", Properties.Resources.SerialKILLER);

                if (!System.IO.File.Exists("StartLauncher.exe"))
                    System.IO.File.WriteAllBytes("StartLauncher.exe", Properties.Resources.StartLauncher);

                return true;
            }
            catch { return false; }
        }
    }
}
